package nl.wubinator.aeve.connectors;

import nl.wubinator.aeve.exceptions.AEveConnectionException;
import nl.wubinator.aeve.models.limited.characters.Characters;
import nl.wubinator.aeve.models.limited.charactersheet.CharacterSheet;
import nl.wubinator.aeve.models.limited.skillqueue.SkillQueue;
import nl.wubinator.aeve.url.LimitedUrls;
import nl.wubinator.aeve.utils.Parameters;
import nl.wubinator.aeve.xmlconverters.limited.CharacterSheetConverter;
import nl.wubinator.aeve.xmlconverters.limited.CharactersSelectionConverter;
import nl.wubinator.aeve.xmlconverters.limited.SkillQueueConverter;

public class LimitedConnector extends ConnectorBase {

	/**
	 * This method will retrieve the characters in an Eve XML for the set
	 * authentication and converts the result to the Characters object before
	 * returning it
	 * 
	 * @return
	 */
	public final Characters getCharacters() throws AEveConnectionException {
		Parameters parameters = new Parameters();
		CharactersSelectionConverter converter = new CharactersSelectionConverter();

		connect(LimitedUrls.CHARACTERS, parameters, converter);
		
		return (Characters) converter.getResult();
	}
	
	/**
	 * This method will retrieve the sheet for a certain character in an Eve XML 
	 * for the provided characterId and converts the result to the CharacterSheet 
	 * instance before returning it
	 * 
	 * @return
	 */
	public final CharacterSheet getCharacterSheet(String characterID) throws AEveConnectionException {
		Parameters parameters = new Parameters();
		parameters.addParameter("characterID", characterID);
		
		CharacterSheetConverter converter = new CharacterSheetConverter();
		
		connect(LimitedUrls.CHARACTER_SHEET, parameters, converter);
		
		return (CharacterSheet) converter.getResult();
	}
	
	public final SkillQueue getSkillQueue(String characterID) throws AEveConnectionException {
		Parameters parameters = new Parameters();
		parameters.addParameter("characterID", characterID);
		
		SkillQueueConverter converter = new SkillQueueConverter();
		
		connect(LimitedUrls.SKILL_QUEUE, parameters, converter);
		
		return (SkillQueue) converter.getResult();
	}
	
	public final void getCorporationSheet() {
		
	}
	
	public final void getMedals() {
		
	}
	
	public final void getCorporationMedals() {
		
	}
	
	public final void getCorporationMemberMedals() {
		
	}
}
